from flask import Blueprint, render_template
from flask_login import current_user, login_required

from FileShare.models import loginfo, User

logs_bp = Blueprint('logs', __name__)

@logs_bp.route('/show')
@login_required
def show_logs():
    username_id = User.query.filter_by(username=current_user.username).first().id
    logs_info = loginfo.query.filter(loginfo.username_id == username_id)

    return render_template('show_logs.html', logs_info=logs_info)


